from time import sleep

from Base.Base import Base
from selenium.webdriver.common.by import By

class Page(Base):
    # 输入用户名
    username_loc = (By.XPATH, '/html/body/div[2]/div/div/div/div/div[3]/div[1]/div/form/div[1]/label[1]/span/input')

    def username(self) :
        self.send_keys(self.username_loc, 'admin')

    # 输入密码
    password_loc = (By.XPATH, '/html/body/div[2]/div/div/div/div/div[3]/div[1]/div/form/div[1]/label[2]/span/input')

    def password(self) :
        self.send_keys(self.password_loc, 'llg123')
        sleep(8)

    # 点击登录
    login_loc = (By.XPATH, '/html/body/div[2]/div/div/div/div/div[3]/div[1]/div/form/div[1]/div[4]/button')

    def login(self) :
        self.click(self.login_loc)
        sleep(5)

    # 断言 WMS仓储管理
    dy1_loc = (By.XPATH, '/html/body/div[2]/div/div[1]/a/small/span')

    def dy1(self) :
        return self.text(self.dy1_loc)